package main

import "fmt"

type Person struct {
	Name string
	Age  int
}

func main() {

	var p1 Person
	p1.Name = "Tom"
	p1.Age = 30
	fmt.Println("p1 =", p1)

	var p2 = Person{Name: "Burke", Age: 31}
	fmt.Println("p2 =", p2)

	p3 := Person{Name: "Aaron", Age: 32}
	fmt.Println("p3 =", p3)

	//匿名结构体
	p4 := struct {
		NameEn string
		Age    int
	}{NameEn: "jack", Age: 12}
	fmt.Println("p4 =", p4)

	setPersonData(&p3)

	fmt.Println("p3 =", p3)
}

func setPersonData(p *Person) {
	p.Name = "豆浆(刚满18岁)"
	p.Age = 18
}
